import appService from '@/utils/appService';
import systemConfig from '@/utils/config';
import util from '@/utils/util';

const baseUrl = `${systemConfig.serverProxy}/trade-merchant`;

/**
 * 查询业务信息
 * @returns {Promise<void>}
 */
export const queryBusinessPage = async params => {
    const res = await appService.getRequest(`${baseUrl}/admin/business/queryPage`, params);
    return res;
};

/**
 * 查询业务信息-list
 * @returns {Promise<void>}
 */
export const queryBusinessList = async params => {
    const res = await appService.getRequest(`${baseUrl}/admin/business/queryList`, params);
    return res;
};
/**
 * 查询业务信息-by id
 * @returns {Promise<void>}
 */
export const queryById = async params => {
    const res = await appService.getRequest(`${baseUrl}/admin/business/${params}`);
    return res;
};
/**
 * 查询业务信息-by id
 * @returns {Promise<void>}
 */
export const addBusiness = async params => {
    const res = await appService.postRequest(`${baseUrl}/admin/business/`, params);
    return res;
};

/**
 * 查询业务信息-by id
 * @returns {Promise<void>}
 */
export const updateBusiness = async params => {
    const res = await appService.putRequest(`${baseUrl}/admin/business/`, params);
    return res;
};

/**
 * 查询业务信息-by id
 * @returns {Promise<void>}
 */
export const deleteBusiness = async params => {
    const res = await appService.deleteRequest(`${baseUrl}/admin/business/${params}`);
    return res;
};

/**
 * 查询业务信息
 * @returns {Promise<void>}
 */
export const queryOrgBusinessPage = async params => {
    const res = await appService.getRequest(`${baseUrl}/admin/orgBusiness/queryPage`, params);
    return res;
};

/**
 * 查询业务信息-list
 * @returns {Promise<void>}
 */
export const queryOrgBusinesssList = async params => {
    const res = await appService.getRequest(`${baseUrl}/admin/orgBusiness/queryList`, params);
    return res;
};
/**
 * 查询业务信息-by id
 * @returns {Promise<void>}
 */
export const queryOrgBusinessById = async params => {
    const res = await appService.getRequest(`${baseUrl}/admin/orgBusiness/${params}`);
    return res;
};
/**
 * 查询业务信息-by id
 * @returns {Promise<void>}
 */
export const addOrgBusiness = async params => {
    const res = await appService.postRequest(`${baseUrl}/admin/orgBusiness/`, params);
    return res;
};

/**
 * 查询业务信息-by id
 * @returns {Promise<void>}
 */
export const updateOrgBusiness = async params => {
    const res = await appService.putRequest(`${baseUrl}/admin/orgBusiness/`, params);
    return res;
};

/**
 * 查询业务信息-by id
 * @returns {Promise<void>}
 */
export const deleteOrgBusiness = async params => {
    const res = await appService.deleteRequest(`${baseUrl}/admin/orgBusiness/${params}`);
    return res;
};

/**
 * 查询所有机构
 * @returns {Promise<void>}
 */
export const allOrg = async () => {
  const res = await appService.getRequest(`${baseUrl}/admin/organization/all`);
  return res;
};

/**
 * 查询商户进件列表
 * @returns {Promise<void>}
 */
export const queryMerchantRegPage = async () => {
  const res = await appService.getRequest(`${baseUrl}/admin/merchantPayReg/findPageList`);
  return res;
};

/**
 * 手动设置银行进件商户号
 * @returns {Promise<void>}
 */
export const manualSettingChannelInfo = async (params) => {
  const res = await appService.postRequest(`${baseUrl}/admin/merchantPayReg/manualSettingChannelInfo`, params);
  return res;
};

/**
 * 查询注册商户明细
 * @returns {Promise<void>}
 */
export const queryMerchantRegInfoById = async (params) => {
    const res = await appService.getRequest(`${baseUrl}/admin/merchantPayReg/queryByRegId`, {regId:params});
    return res;
  };
  